import http from "../utils/request";
// 报名相关接口

//
export function importData(data) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/importData`,
    method: "post",
    "Content-Type":
      "multipart/form-data; boundary=--------------------------429878037138410491126507",
    data: data,
  });
}

export function getImportFileList() {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/getImportFileList`,
    method: "get",
  });
}

export function getTimeDomainMap(data) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/getTimeDomainMap`,
    method: "post",
    data: data,
  });
}

// algorithmType
export function getAlgorithmByType(query) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/getAlgorithmByType`,
    method: "get",
    params: query,
  });
}


export function executeAlgorithm(data) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/executeAlgorithm`,
    method: "post",
    data: data,
  });
}

export function algorithmTypeTree(query) {
  return http({
    url: `/underwater-sound/algorithmManagement/algorithmTypeTree`,
    method: "get",
    params: query,
  });
}

// No parameters
export function SignalDetection(query) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/SignalDetection`,
    method: "get",
    params: query,
  });
}
// // No parameters
// export function signalEstimation(query) {
//   return http({
//     url: `/underwater-sound/dataAlgorithmsProcessing/signalEstimation`,
//     method: "get",
//     params: query,
//   });
// }
// No parameters
export function underwaterSignalSort(data) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/underwaterSignalSort`,
    method: "post",
    data: data,
  });
}

/***
 *
 * 算法管理 */

// 右上角算法导入
export function addAlgorithm(data) {
  return http({
    url: `/underwater-sound/algorithmManagement/addAlgorithm`,
    method: "post",
    "Content-Type":
      "multipart/form-data; boundary=--------------------------429878037138410491126507",
    data: data,
  });
}
export function checkSameTypeAlgorithmIsOnline(query) {
  return http({
    url: `/underwater-sound/algorithmManagement/checkSameTypeAlgorithmIsOnline`,
    method: "get",
    params: query,
  });
}
export function delAlgorithm(algorithmId) {
  return http({
    url: `/underwater-sound/algorithmManagement/delAlgorithm/${algorithmId}`,
    method: "post",
  });
}

// fileType  doc 0   算法说明文档 1
export function downloadFile(query) {
  return http({
    url: `/underwater-sound/algorithmManagement/downloadFile`,
    method: "get",
    responseType: "blob",
    params: query,
  });
}
export function getAlgorithmInfo(query) {
  return http({
    url: `/underwater-sound/algorithmManagement/getAlgorithmInfo`,
    method: "get",
    params: query,
  });
}
export function getAlgorithmVersionInfo(query) {
  return http({
    url: `/underwater-sound/algorithmManagement/getAlgorithmVersionInfo`,
    method: "get",
    params: query,
  });
}
export function updateAlgorithm(data) {
  return http({
    url: `/underwater-sound/algorithmManagement/updateAlgorithm`,
    method: "post",
    data: data,
  });
}

export function callingAlgorithm(query) {
  return http({
    url: `/underwater-sound/dataAlgorithmsProcessing/callingAlgorithm`,
    method: "get",
    params: query,
  });
}
